package com.jmda.platform.plugs.selector.service;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Service;

import com.jmda.platform.plugs.selector.model.SelectorPo;




@Service("selectorByMyBatisService")
public class SelectorByMyBatisServiceImpl extends SqlSessionDaoSupport {

	public List<Map<String, Object>> queryDatas(SelectorPo cfg, int page, int pagesize, Map<String, Object> params) {
		return getSqlSession().selectList(cfg.getMapperid(), params, new RowBounds(page*pagesize, pagesize));
	}
	
	public int queryDatasTotal(SelectorPo cfg,  Map<String, Object> params) {
		return getSqlSession().selectOne(cfg.getTotalMapperid(),params);
	}
}
